<%
layout("/layouts/platform.html"){
%>
<%DIRECTIVE DYNAMIC;%>
<form id="companyAddForm" role="form" class="form-horizontal parsley-form" data-parsley-validate action="${base}/platform/student/editDo" method="post">
<header class="header navbar bg-white shadow">
    <div class="btn-group tool-button">
        <a class="btn btn-default navbar-btn" href="${base}/platform/student" data-pjax><i class="ti-angle-left" id="goback"></i> 返回</a>
    </div>
    <div class="pull-right">
    	<div class="btn-group tool-button">
    	 	<button class="btn btn-default navbar-btn" data-loading-text="正在提交...">提 交</button>
        </div>
   </div>
</header>

<div class="content-wrap">
	<div class="wrapper" style="min-height:500px;height: 100%;">
		<div class="box-tab">
			<ul class="nav nav-tabs">
				<li class="active">
          			<a href="#base_info" data-toggle="tab">基本信息</a>
				</li>
                <li>
                	<a href="#ruxuexinxi" data-toggle="tab">入学信息</a>
                </li>
                <li>
                	<a href="#kemuyi" data-toggle="tab">科目一</a>
                </li>
                <li>
                	<a href="#kemuer" data-toggle="tab">科目二</a>
                </li>
                <li>
                	<a href="#kemusan" data-toggle="tab">科目三</a>
                </li>
                <li>
                	<a href="#kemusi" data-toggle="tab">科目四</a>
                </li>
           	</ul>
			<div class="tab-content">
				<input type="hidden" name="id" value="${obj.student.id!}"/>
                <input type="hidden" name="customer_id" value="${obj.student.customer_id!}"/>
                <input type="hidden" name="enroll_id" value="${obj.student.enroll_id!}"/>
         		<div class="tab-pane fade active in" id="base_info">
         			<div class="row mb10">
                		<div class="form-group">
                            <label for="state" class="col-sm-2 control-label">当前状态</label>
                            <div class="col-sm-8" style="margin-top: 5px">
                                <input type="radio" name="state"   value="0" <% if(obj.student.state ==0){%>checked="checked"<%}%> />正常
                                <input type="radio" name="state"   value="1" <% if(obj.student.state ==1){%>checked="checked"<%}%> />失效
                                <input type="radio" name="state"   value="2" <% if(obj.student.state ==2){%>checked="checked"<%}%> />过期
                            </div>
                        </div>
                        <div class="form-group">
                        	<label for="progress" class="col-sm-2 control-label">学习进度</label>
                            <div class="col-sm-8" style="margin-top: 5px">
                                <input type="radio" name="progress"   value="0" <% if(obj.student.progress ==0){%>checked="checked"<%}%> />入学
                                <input type="radio" name="progress"   value="1" <% if(obj.student.progress ==1){%>checked="checked"<%}%> />理论培训
                                <input type="radio" name="progress"   value="2" <% if(obj.student.progress ==2){%>checked="checked"<%}%> />操作培训
                                <input type="radio" name="progress"   value="2" <% if(obj.student.progress ==9){%>checked="checked"<%}%> />完成
                            </div>
                        </div>
                     	<div class="form-group">
                            <label for="name" class="col-sm-2 control-label">名称</label>
                            <div class="col-sm-2">
                                <input type="text" id="name" value="${obj.student.name!}" class="form-control" name="name"   placeholder="名称">
                            </div>
                            
                            <label for="mobile" class="col-sm-2 control-label">电话</label>
                            <div class="col-sm-2">
                                <input type="text" id="mobile"  value="${obj.student.mobile!}" class="form-control" name="mobile"  placeholder="电话"   data-parsley-type="number">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="id_no" class="col-sm-2 control-label">身份证</label>
                            <div class="col-sm-2">
                                <input type="text" id="id_no" value="${obj.student.id_no!}" class="form-control" name="id_no"   placeholder="身份证">
                            </div>
                            
	                 		<label for="birth" class="col-sm-2 control-label">出生日期</label>
	                 		<div class="col-sm-2 "  >
	                      		<input type="text" class="form-control" value="${@date.getDateString(obj.student.birth!)}"   id="birth" name="birth">
	                        </div>
                        </div>
                        <div class="form-group">
                            <label for="sex" class="col-sm-2 control-label">性别</label>
                            <div class="col-sm-2" style="margin-top: 5px">
                                 <input type="radio" name="sex"   value="0" <% if(obj.student.sex =='0'){%>checked="checked"<%}%> />男
                                 <input type="radio" name="sex"   value="1" <% if(obj.student.sex =='1'){%>checked="checked"<%}%> />女
                            </div>
                            
                            <label for="company_id" class="col-sm-2 control-label">档案归属</label>
	                 		<div class="col-sm-2">
                                <input type="text"  value="${obj.company.name!}" class="form-control" readonly="readonly"  placeholder="档案归属">
                                <input type="hidden"  value="${obj.company.id!}" name="company_id" >
                            </div>
                        </div>
               		</div>
         		</div>
         		<div class="tab-pane fade" id="ruxuexinxi">
         			<div class="row mb10">
                		<div class="form-group">
                            <label for="enroll_state" class="col-sm-2 control-label">当前状态</label>
                            <div class="col-sm-8 "  style="margin-top: 5px">
                             	<input type="radio" name="enroll_state"   value="0" <% if(obj.student.enroll_state ==0){%>checked="checked"<%}%> />未完成
                           		<input type="radio" name="enroll_state"   value="1" <% if(obj.student.enroll_state ==1){%>checked="checked"<%}%> />已完成
                            </div>
                        </div>  
                        
                        <div class="form-group">  
                            <label for="enroll_progress" class="col-sm-2 control-label">当前进度</label>
	                 		<div class="col-sm-8" style="margin-top: 5px">
	                 			<%for(en_progress in obj.enroll_progress){%>
	                                <input type="radio" name="enroll_progress"   value="${en_progress.step}" <% if(obj.student.enroll_progress ==en_progress.step){%>checked="checked"<%}%> />${en_progress.name}
                                <%}%>
                            </div>
                        </div>
                        
                		<div class="form-group">
                			<label for="school_id" class="col-sm-2 control-label">分配驾校</label>
	                 		<div class="col-sm-3">
	                 			<select id="school_id" name="school_id" class="form-control" >
                                	<option value="">--选择驾校--</option>
                                	<%for(school in obj.schoolList){%>
                                		 <option value="${school.id}"  <% if(obj.student.school_id ==school.id){%>selected="selected"<%}%> >${school.name}</option>
                                	<%}%>
                                </select>
                            </div>
                      	</div>  
                        
                        <div class="form-group">  
                            <label for="driving_type" class="col-sm-2 control-label">驾考类型</label>
	                 		<div class="col-sm-3">
	                 			<select id="driving_type" name="driving_type" class="form-control" >
                                	<option value="">--选择驾考类型--</option>
                                	<option value="C1"  <% if(obj.student.driving_type =='C1'){%>selected="selected"<%}%> >C1</option>
                                	<option value="C2"  <% if(obj.student.driving_type =='C2'){%>selected="selected"<%}%> >C2</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                        	<label for="enroll_time" class="col-sm-2 control-label">报名时间</label>
                            <div class="col-sm-3">
	                         	<input type="text" class="form-control" id="enroll_time" name="enroll_timeStr" value="${@date.getDateInteger(obj.student.enroll_time!)}" />
	                		</div>
                        </div>
                	</div>
         		</div>
         		<div class="tab-pane fade" id="kemuyi">
         			<div class="row mb10">
                		<div class="form-group">
                            <label for="subject1_state" class="col-sm-2 control-label">当前状态</label>
                            <div class="col-sm-8 "  style="margin-top: 5px">
                                <input type="radio" name="subject1_state"   value="-1" <% if(obj.student.subject1_state ==-1){%>checked="checked"<%}%> />未报名
                                <input type="radio" name="subject1_state"   value="0" <% if(obj.student.subject1_state ==0){%>checked="checked"<%}%> />培训中
                           		<input type="radio" name="subject1_state"   value="1" <% if(obj.student.subject1_state ==1){%>checked="checked"<%}%> />已通过
                            </div>
                      	</div>
                      	<div class="form-group">
                            <label for="subject1_pass_time" class="col-sm-2 control-label">通过时间</label>
                            <div class="col-sm-3">
	                         	<input type="text" class="form-control" id="subject1_pass_time" name="subject1_pass_timeStr" value="${@date.getDateInteger(obj.student.subject1_pass_time!)}" />
	                		</div>
                        </div>
                	</div>
         		</div>
         		<div class="tab-pane fade" id="kemuer">
         			<div class="row mb10">
                		<div class="form-group">
                            <label for="subject2_state" class="col-sm-2 control-label">当前状态</label>
                            <div class="col-sm-8 "  style="margin-top: 5px">
                                <input type="radio" name="subject2_state"   value="-1" <% if(obj.student.subject2_state ==-1){%>checked="checked"<%}%> />未报名
                                <input type="radio" name="subject2_state"   value="0" <% if(obj.student.subject2_state ==0){%>checked="checked"<%}%> />待安排
                           		<input type="radio" name="subject2_state"   value="1" <% if(obj.student.subject2_state ==1){%>checked="checked"<%}%> />培训中
                           		<input type="radio" name="subject2_state"   value="2" <% if(obj.student.subject2_state ==2){%>checked="checked"<%}%> />已通过
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="subject2_progress" class="col-sm-2 control-label">培训进度</label>
                            <div class="col-sm-8 "  style="margin-top: 5px">
                                <%for(en_progress in obj.train_progress){%>
	                                <input type="radio" name="subject2_progress"   value="${en_progress.step}" <% if(obj.student.subject2_progress ==en_progress.step){%>checked="checked"<%}%> />${en_progress.name}
                                <%}%>
                            </div>
                        </div>
                        <div class="form-group">
                        	<label for="subject2_address" class="col-sm-2 control-label">初选场地</label>
                            <div class="col-sm-3">
                                <input type="text" id="subject2_address"  value="${obj.student.subject2_address!}" class="form-control" name="subject2_address"  placeholder="初选场地" >
                            </div>
                      	</div>
                      	<div class="form-group">
                        	<label for="subject2_field" class="col-sm-2 control-label">首选场地</label>
                            <div class="col-sm-3">
                                <select id="subject2_field" name="subject2_field" class="form-control" >
                                	<option value="">--选择场地--</option>
                                	<%for(field in obj.fieldList){%>
                                		 <option value="${field.id}"  <% if(obj.student.subject2_field ==field.id){%>selected="selected"<%}%> >${field.name}</option>
                                	<%}%>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                        	<label for="subject2_mode" class="col-sm-2 control-label">培训方式</label>
                            <div class="col-sm-3" style="margin-top: 5px">
                                <input type="radio" name="subject2_mode"   value="-1" <% if(obj.student.subject2_mode ==-1){%>checked="checked"<%}%> />未指定
                                <input type="radio" name="subject2_mode"   value="0" <% if(obj.student.subject2_mode ==0){%>checked="checked"<%}%> />计时
                           		<input type="radio" name="subject2_mode"   value="1" <% if(obj.student.subject2_mode ==1){%>checked="checked"<%}%> />包干
                            </div>
                      	</div>
                      	<div class="form-group">
                        	<label for="subject2_trainer" class="col-sm-2 control-label">首选教练</label>
                            <div class="col-sm-3">
                                <select id="subject2_trainer" name="subject2_trainer" class="form-control" >
                                	<option value="">--选择教练--</option>
                                	<%for(coach in obj.coachList){%>
                                		 <option value="${coach.id}"  <% if(obj.student.subject2_trainer ==coach.id){%>selected="selected"<%}%> >${coach.name}</option>
                                	<%}%>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                        	<label for="subject2_start_time" class="col-sm-2 control-label">开始时间</label>
                            <div class="col-sm-3">
	                         	<input type="text" class="form-control" id="subject2_start_time" name="subject2_start_timeStr" value="${@date.getDateInteger(obj.student.subject2_start_time!)}" />
	                		</div>
	                	</div>
	                	<div class="form-group">
	                		<label for="subject2_pass_time" class="col-sm-2 control-label">通过时间</label>
                            <div class="col-sm-3">
	                         	<input type="text" class="form-control" id="subject2_pass_time" name="subject2_pass_timeStr" value="${@date.getDateInteger(obj.student.subject2_pass_time!)}" />
	                		</div>
                        </div>
                        <div class="form-group">
                        	<label for="subject2_class_hours" class="col-sm-2 control-label">学时</label>
                            <div class="col-sm-3">
                                 <input type="text" id="subject2_class_hours"  value="${obj.student.subject2_class_hours!}" class="form-control" name="subject2_class_hours"  placeholder="学时" >
                            </div>
                        </div>
                	</div>
         		</div>
         		<div class="tab-pane fade" id="kemusan">
         			<div class="row mb10">
                		<div class="form-group">
                            <label for="subject3_state" class="col-sm-2 control-label">当前状态</label>
                            <div class="col-sm-8 "  style="margin-top: 5px">
                                <input type="radio" name="subject3_state"   value="-1" <% if(obj.student.subject3_state ==-1){%>checked="checked"<%}%> />未报名
                                <input type="radio" name="subject3_state"   value="0" <% if(obj.student.subject3_state ==0){%>checked="checked"<%}%> />待安排
                           		<input type="radio" name="subject3_state"   value="1" <% if(obj.student.subject3_state ==1){%>checked="checked"<%}%> />培训中
                           		<input type="radio" name="subject3_state"   value="2" <% if(obj.student.subject3_state ==2){%>checked="checked"<%}%> />已通过
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="subject3_progress" class="col-sm-2 control-label">培训进度</label>
                            <div class="col-sm-8 "  style="margin-top: 5px">
                                <%for(en_progress in obj.train_progress){%>
	                                <input type="radio" name="subject3_progress"   value="${en_progress.step}" <% if(obj.student.subject3_progress ==en_progress.step){%>checked="checked"<%}%> />${en_progress.name}
                                <%}%>
                            </div>
                        </div>
                        <div class="form-group">
                        	<label for="subject3_address" class="col-sm-2 control-label">初选场地</label>
                            <div class="col-sm-3">
                                <input type="text" id="subject3_address"  value="${obj.student.subject3_address!}" class="form-control" name="subject3_address"  placeholder="初选场地" >
                            </div>
                      	</div>
                        <div class="form-group">
                        	<label for="subject3_field" class="col-sm-2 control-label">首选场地</label>
                            <div class="col-sm-3">
                                <select id="subject3_field" name="subject3_field" class="form-control" >
                                	<option value="">--选择场地--</option>
                                	<%for(field in obj.fieldList){%>
                                		 <option value="${field.id}"  <% if(obj.student.subject3_field ==field.id){%>selected="selected"<%}%> >${field.name}</option>
                                	<%}%>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                        	<label for="subject3_mode" class="col-sm-2 control-label">培训方式</label>
                            <div class="col-sm-8" style="margin-top: 5px">
                                <input type="radio" name="subject3_mode"   value="-1" <% if(obj.student.subject3_mode ==-1){%>checked="checked"<%}%> />未指定
                                <input type="radio" name="subject3_mode"   value="0" <% if(obj.student.subject3_mode ==0){%>checked="checked"<%}%> />计时
                           		<input type="radio" name="subject3_mode"   value="1" <% if(obj.student.subject3_mode ==1){%>checked="checked"<%}%> />包干
                            </div>
                       	</div>
                       	<div class="form-group">
                        	<label for="subject3_trainer" class="col-sm-2 control-label">首选教练</label>
                            <div class="col-sm-3">
                                <select id="subject3_trainer" name="subject3_trainer" class="form-control" >
                                	<option value="">--选择教练--</option>
                                	<%for(coach in obj.coachList){%>
                                		 <option value="${coach.id}"  <% if(obj.student.subject3_trainer ==coach.id){%>selected="selected"<%}%> >${coach.name}</option>
                                	<%}%>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                        	<label for="subject3_start_time" class="col-sm-2 control-label">开始时间</label>
                            <div class="col-sm-3">
	                         	<input type="text" class="form-control" id="subject3_start_time" name="subject3_start_timeStr" value="${@date.getDateInteger(obj.student.subject3_start_time!)}" />
	                		</div>
                        </div>
                        <div class="form-group">
                        	<label for="subject3_pass_time" class="col-sm-2 control-label">通过时间</label>
                            <div class="col-sm-3">
	                         	<input type="text" class="form-control" id="subject3_pass_time" name="subject3_pass_timeStr" value="${@date.getDateInteger(obj.student.subject3_pass_time!)}" />
	                		</div>
                        </div>
                        <div class="form-group">
                        	<label for="subject3_class_hours" class="col-sm-2 control-label">学时</label>
                            <div class="col-sm-3">
                                 <input type="text" id="subject3_class_hours"  value="${obj.student.subject3_class_hours!}" class="form-control" name="subject3_class_hours"  placeholder="学时" >
                            </div>
                        </div>
                	</div>
         		</div>
         		<div class="tab-pane fade" id="kemusi">
         		 	<div class="row mb10">
                		<div class="form-group">
                            <label for="subject4_state" class="col-sm-2 control-label">当前状态</label>
                            <div class="col-sm-8 "  style="margin-top: 5px">
                                <input type="radio" name="subject4_state"   value="-1" <% if(obj.student.subject4_state ==-1){%>checked="checked"<%}%> />未报名
                                <input type="radio" name="subject4_state"   value="0" <% if(obj.student.subject4_state ==0){%>checked="checked"<%}%> />待安排
                           		<input type="radio" name="subject4_state"   value="1" <% if(obj.student.subject4_state ==1){%>checked="checked"<%}%> />培训中
                           		<input type="radio" name="subject4_state"   value="2" <% if(obj.student.subject4_state ==1){%>checked="checked"<%}%> />已通过
                            </div>
                        </div>
                        <div class="form-group">
                        	<label for="subject4_pass_time" class="col-sm-2 control-label">通过时间</label>
                            <div class="col-sm-3">
	                         	<input type="text"  class="form-control"  id="subject4_pass_time" name="subject4_pass_timeStr" value="${@date.getDateInteger(obj.student.subject4_pass_time!)}" />
	                		</div>
                        </div>
                    </div>
         		</div>
         	</div>
   		</div>
    </div>
</div>
</form>
<script language="JavaScript">
    $(document).ready(function () {
   		$.datetimepicker.setLocale('ch');
      	$('#birth').datetimepicker({
     		lang:'ch',
       		timepicker:false,
       		format:'Y-m-d',
       		formatDate:'Y-m-d'
     	});
       	$('#enroll_time').datetimepicker({
        	lang:'ch',
           	format:'Y-m-d H:i:s'
       	});
       	$('#subject1_pass_time').datetimepicker({
        	lang:'ch',
           	format:'Y-m-d H:i:s'
       	}); 
       	$('#subject2_start_time').datetimepicker({
        	lang:'ch',
           	format:'Y-m-d H:i:s'
       	}); 
       	$('#subject3_start_time').datetimepicker({
        	lang:'ch',
           	format:'Y-m-d H:i:s'
       	}); 
       	$('#subject2_pass_time').datetimepicker({
        	lang:'ch',
           	format:'Y-m-d H:i:s'
       	}); 
       	$('#subject3_pass_time').datetimepicker({
        	lang:'ch',
           	format:'Y-m-d H:i:s'
       	}); 
       	$('#subject4_pass_time').datetimepicker({
        	lang:'ch',
           	format:'Y-m-d H:i:s'
       	}); 
        $('#companyAddForm').ajaxForm({
            dataType: 'json',
            beforeSubmit: function (arr, form, options) {
            },
            success: function (data, statusText, xhr, form) {
                if (data.code==0) {
                    Toast.success(data.msg);
                    setTimeout(function () {
                        $("#goback").trigger("click");
                    }, 1000);
                } else {
                    Toast.error(data.msg);
                }
            }
        });
    });
</script>
<%}%>